<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>鼓励金记录</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/store/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="__INDEX__/store/css/style.css"/>
		<link rel="stylesheet" href="__INDEX__/store/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/store/css/wallet.css" />
		<script type="text/javascript" src="__INDEX__/dist/jquery.min.js" ></script>
		<script type="text/javascript" src="__INDEX__/js/menudown.js" ></script>
		<link rel="stylesheet" href="__INDEX__/store/css/newsj.css" />
	</head>

	<body style="background: white;">
		<header class="mui-bar mui-bar-nav">
		    <a class=" mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		    <h1 class="mui-title">鼓励金记录</h1>
		</header>
		<div class="mui-content" style="background: white;">
		    <ul class="record_list2" id="yongj_ul">

		    </ul>
		</div> 
		<div class="gljjl_btnbox" style="background: #1DAA39;">
				<a href="exchange.html" style="font-size: 1.2rem;">鼓励金兑现</a>
				<!--<a href="{$code_url}">购券</a>-->
		</div> 
		<input type="hidden" id="page" value="1" />
	</body>

</html>
{include file="public/footer" /}
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script>

	$.ajax({
		type:"post",
		data:{
			page:$("#page").val()
		},
		url:"{:url('store/agent/score_records')}",
		success:function(data){	
			var list=data.list;
			var html="";
			if(list != ''){
				for(var i=0;i<list.length;i++){
					var log=list[i];
					html+='<li class="clearfix">'+
				    		'<div class="left">'+
								'<p class="list_nam">'+log.message+'</p>'+
								'<p class="list_time">'+log.add_time+'</p>'+
							'</div>'+
				    		'<div class="right" style="color: #1DAA39;">'+log['balance']+'</div>'+
			    		   '</li>';
				}
			}else{
				html="<img src='__PUBLIC__/static/wx/images/ddnone.jpg' style='margin-top: 120px;'>";
				
			}
			$(".record_list2").html(html);
			
		}
	});
	
	
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('store/agent/score_records')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
					    		'<div class="left">'+
									'<p class="list_nam">'+log.message+'</p>'+
									'<p class="list_time">'+log.add_time+'</p>'+
								'</div>'+
					    		'<div class="right" style="color: #1DAA39;">'+log['balance']+'</div>'+
				    		   '</li>';
					}
				}else{
					html="已经到最后";
				}
				$(".record_list2").append(html);
				
			}
		});
		
		}				
	})
</script>
